{% extends "page.html" %}
{% import "macros/form.html" as form %}

{% block subtitle %}{{ _('Reset Your Password') }}{% endblock %}

{% block breadcrumb_content %}
  <li class="active">{{ _('Password Reset') }}</li>
{% endblock %}

{% block primary_content %}
  <article class="module">
    {% block primary_content_inner %}
    <div class="module-content">
      <h1 class="page-heading">
        {% block page_heading %}{{ _('Reset Your Password') }}{% endblock %}
      </h1>
      {% block form %}
        <form action="" method="post">
          {{ form.errors(error_summary) }}
          {% if user_dict['state'] == 'pending' %}
            <p>{{ _('You can also change username. It can not be modified later.') }}</p>
            {{ form.input("name", id="field-name", label=_("Username"), type="text", value=user_dict["name"],
               error='', attrs={'autocomplete': 'no', 'class': 'form-control control-medium'}, classes=["form-group"]) }}
          {% endif %}
          {{ form.input("password1", id="field-password", label=_("Password"), type="password", value='', error='', attrs={'autocomplete': 'no', 'class': 'form-control control-medium'}, classes=["form-group"]) }}
          {{ form.input("password2", id="field-confirm-password", label=_("Confirm"), type="password", value='', error='', attrs={'autocomplete': 'no', 'class': 'form-control control-medium'}, classes=["form-group"]) }}
          <div class="form-actions">
            {% block form_button %}
            <button class="btn btn-primary" type="submit" name="save">{{ _("Update Password") }}</button>
            {% endblock %}
          </div>
        </form>
      {% endblock %}
    </div>
    {% endblock %}
  </article>
{% endblock %}

{% block secondary_content %}
  {% block help %}
  <section class="module module-narrow module-shallow">
    {% block help_inner %}
    <h2 class="module-heading">{{ _('How does this work?') }}</h2>
    <div class="module-content">
      <p>{% trans %}Simply enter a new password and we'll update your account{% endtrans %}</p>
    </div>
    {% endblock %}
  </section>
  {% endblock %}
{% endblock %}
